package com.example.Service.impl;

import com.example.Service.CampusResourceService;
import com.example.entity.CampusResource;
import com.example.mapper.CampusResourceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CampusResourceServiceImpl implements CampusResourceService {

    @Autowired
    private CampusResourceMapper campusResourceMapper;

    @Override
    public int addResource(CampusResource resource) {
        return campusResourceMapper.insertCampusResource(resource);
    }

    @Override
    public int deleteResourceById(Integer resourceId) {
        return campusResourceMapper.deleteCampusResourceById(resourceId);
    }

    @Override
    public int updateResource(CampusResource resource) {
        return campusResourceMapper.updateCampusResource(resource);
    }

    @Override
    public List<CampusResource> getAllResources() {
        return campusResourceMapper.getAllCampusResources();
    }
}
